﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SilverTile.Xaml;
using System.Collections.Generic;
using System.Linq;

namespace SilverTileTests
{
    [TestClass]
    public class XamlFrameAnimationTests
    {
        [TestMethod]
        public void FrameAnimation_Should_Have_A_Name()
        {
            FrameAnimation anim = new FrameAnimation();
            anim.SetValue(FrameAnimation.NameProperty, "Name");

            Assert.AreEqual(anim.Name, anim.GetValue(FrameAnimation.NameProperty), "NameProperty and Name should map to the same value");
        }

        [TestMethod]
        public void FrameAnimation_Should_Have_A_List_Of_SpriteFrames()
        {

            FrameAnimation anim = new FrameAnimation();
            var frames = new List<SpriteFrame>() { new SpriteFrame(), new SpriteFrame() };

            anim.SetValue(FrameAnimation.FramesProperty, frames);

            Assert.AreSame(anim.Frames, anim.GetValue(FrameAnimation.FramesProperty), "FramesProperty and Frames should map to the same object");

            Assert.AreEqual(frames.Count, anim.Frames.Count(), "Frames property should store the correct value");

        }

    }
}